
import { UPDATE_LOADING_REDUX } from './actionTypes';
import preloadedState from '../../preloadedState';

const defaultLoading = preloadedState.get('loading');

function reducer(state = defaultLoading, action) {
    const { type, payload } = action;
    let newState;

    switch (type) {
        case UPDATE_LOADING_REDUX:
            newState = payload;
            return newState;
     
        default:
            return state;
    }
}

export default reducer;
